<div class="wrapper wrapper-content animated fadeInRight ecommerce">
    <div class="row">
        <div class="col-md-1 padding-r-0">
            <div class=" border-radius ">
                <div class="margin-xs-r  treeview attendance-staff">
                    <ul class="list-group text-center border-radius">
                        <li class="list-group-item node-orgTree "
                            v-for="(item,index) in purchaseApplyDetailManageInfo.resOrderTypes" :key="index"
                            @click="swatchResOrderTypes(item)"
                            :class="{'vc-node-selected':purchaseApplyDetailManageInfo.conditions.resOrderType == item.statusCd}">
                            {{item.name}}
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-md-11">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox ">
                        <div class="ibox-title">
                            <h5>
                                <vc:i18n name="查询条件" namespace="purchaseApplyDetailManage"></vc:i18n>
                            </h5>
                            <div class="ibox-tools" style="top:10px;">
                                <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
                                        v-on:click="_moreCondition()">
                                    {{purchaseApplyDetailManageInfo.moreCondition == true?'隐藏':'更多'}}
                                </button>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <div class="row">
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <input type="text" :placeholder="vc.i18n('请填写申请单号','purchaseApplyDetailManage')"
                                               v-model.trim="purchaseApplyDetailManageInfo.conditions.applyOrderId"
                                               class=" form-control">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <select class="custom-select"
                                            v-model="purchaseApplyDetailManageInfo.conditions.state">
                                        <option selected value="">
                                            {{vc.i18n('请选择状态','purchaseApplyDetailManage')}}
                                        </option>
                                        <option v-for="(item,index) in purchaseApplyDetailManageInfo.states"
                                                :key="index" v-bind:value="item.statusCd">{{item.name}}
                                        </option>
                                    </select>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <input type="text" class=" form-control"
                                               :placeholder="vc.i18n('请填写申请人姓名','purchaseApplyDetailManage')"
                                               v-model.trim="purchaseApplyDetailManageInfo.conditions.name">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <input type="text" class="form-control"
                                               :placeholder="vc.i18n('请填写使用人姓名','purchaseApplyDetailManage')"
                                               v-model.trim="purchaseApplyDetailManageInfo.conditions.endUserName">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <input type="text" :placeholder="vc.i18n('请填写物品名称','purchaseApplyDetailManage')"
                                               class="form-control"
                                               v-model.trim="purchaseApplyDetailManageInfo.conditions.resName">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <button type="button" class="btn btn-primary btn-sm"
                                            v-on:click="_queryInspectionPlanMethod()">
                                        <i class="fa fa-search"></i>
                                        <span><vc:i18n name="查询" namespace="purchaseApplyDetailManage"></vc:i18n></span>
                                    </button>
                                    <button type="button" class="btn btn-primary btn-sm"
                                            v-on:click="_resetInspectionPlanMethod()">
                                        <i class="fa fa-repeat"></i>
                                        <span><vc:i18n name="重置" namespace="purchaseApplyDetailManage"></vc:i18n></span>
                                    </button>
                                </div>
                            </div>
                            <div class="row" v-show="purchaseApplyDetailManageInfo.moreCondition == true">
                                <div class="col-sm-2">
                                    <select class="custom-select"
                                            v-model="purchaseApplyDetailManageInfo.conditions.warehousingWay">
                                        <option selected value="">
                                            {{vc.i18n('请选择采购方式','purchaseApplyDetailManage')}}
                                        </option>
                                        <option v-for="(item,index) in purchaseApplyDetailManageInfo.warehousingWays"
                                                :key="index" v-bind:value="item.statusCd">{{item.name}}
                                        </option>
                                    </select>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group input-group">
                                        <input type="text" class=" form-control startTime"
                                               :placeholder="vc.i18n('请选择创建开始时间','purchaseApplyDetailManage')"
                                               v-model="purchaseApplyDetailManageInfo.conditions.startTime">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group input-group">
                                        <input type="text" class=" form-control endTime"
                                               :placeholder="vc.i18n('请选择创建结束时间','purchaseApplyDetailManage')"
                                               v-model="purchaseApplyDetailManageInfo.conditions.endTime">
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <select class="custom-select"
                                                v-model="purchaseApplyDetailManageInfo.conditions.parentRstId"
                                                @change="_listResourceStoreSonTypes">
                                            <option selected value="">
                                                {{vc.i18n('请选择物品类型','purchaseApplyDetailManage')}}
                                            </option>
                                            <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceStoreTypes"
                                                    :key="index" v-bind:value="item.rstId">
                                                {{item.name}}
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="input-group">
                                        <select class="custom-select"
                                                v-model="purchaseApplyDetailManageInfo.conditions.rstId"
                                                @change="_listResourceStoreSpecifications">
                                            <option selected value="">
                                                {{vc.i18n('请选择二级分类','purchaseApplyDetailManage')}}
                                            </option>
                                            <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceStoreSonTypes"
                                                    :key="index" v-bind:value="item.rstId">
                                                {{item.name}}
                                            </option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row" v-show="purchaseApplyDetailManageInfo.moreCondition == true">
                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <select class="custom-select"
                                                v-model="purchaseApplyDetailManageInfo.conditions.rssId">
                                            <option selected value="">
                                                {{vc.i18n('请选择物品规格','purchaseApplyDetailManage')}}
                                            </option>
                                            <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceStoreSpecifications"
                                                    :key="index" v-bind:value="item.rssId">
                                                {{item.specName}}
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group input-group">
                                        <select class="custom-select"
                                                v-model="purchaseApplyDetailManageInfo.conditions.rsId">
                                            <option selected value="">
                                                {{vc.i18n('请选择供应商','purchaseApplyDetailManage')}}
                                            </option>
                                            <option v-for="(item,index) in purchaseApplyDetailManageInfo.resourceSuppliers"
                                                    :key="index" :value="item.rsId">
                                                {{item.supplierName}}
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <div class="form-group input-group">
                                        <select class="custom-select"
                                                v-model="purchaseApplyDetailManageInfo.conditions.shId">
                                            <option selected value="">
                                                {{vc.i18n('请选择仓库','purchaseApplyDetailManage')}}
                                            </option>
                                            <option v-for="(item,index) in purchaseApplyDetailManageInfo.storehouses"
                                                    :key="index" :value="item.shId">
                                                {{item.shName}}
                                            </option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox">
                        <div class="ibox-title">
                            <h5>
                                <vc:i18n name="出入库明细" namespace="purchaseApplyDetailManage"></vc:i18n>
                            </h5>
                            <div class="ibox-tools" style="top:10px;">
                                <button type="button" class="btn btn-primary btn-sm" v-on:click="_exportExcel()">
                                    <i class="fa fa-plus"></i>
                                    <vc:i18n name="导出" namespace="purchaseApplyDetailManage"></vc:i18n>
                                </button>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
                                <thead>
                                <tr>
                                    <th class="text-center">
                                        <vc:i18n name="申请单号" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="申请人" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="使用人" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="出入库类型" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="物品类型" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="物品名称" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="物品规格" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="固定物品" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="供应商" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="物品仓库" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="采购/出库方式" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="申请数量" namespace="purchaseApplyDetailManage"></vc:i18n>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="采购/出库数量" namespace="purchaseApplyDetailManage"></vc:i18n>
                                        </span>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="采购价格" namespace="purchaseApplyDetailManage"></vc:i18n>
                                        </span>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="总价" namespace="purchaseApplyDetailManage"></vc:i18n>
                                        </span>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="申请备注" namespace="purchaseApplyDetailManage"></vc:i18n>
                                        </span>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="状态" namespace="purchaseApplyDetailManage"></vc:i18n>
                                        </span>
                                    </th>
                                    <th class="text-center">
                                        <vc:i18n name="创建时间" namespace="purchaseApplyDetailManage"></vc:i18n>
                                        </span>
                                    </th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr v-for="purchaseApplyDetail in purchaseApplyDetailManageInfo.purchaseApplyDetails">
                                    <td class="text-center">{{purchaseApplyDetail.applyOrderId}}</td>
                                    <td class="text-center">{{purchaseApplyDetail.userName}}</td>
                                    <td class="text-center">{{purchaseApplyDetail.endUserName}}</td>
                                    <td class="text-center">{{purchaseApplyDetail.resOrderTypeName}}</td>
                                    <td class="text-center">
                                        {{purchaseApplyDetail.parentRstName}} > {{purchaseApplyDetail.rstName}}
                                    </td>
                                    <td class="text-center">{{purchaseApplyDetail.resName}}</td>
                                    <td class="text-center">
                                        {{purchaseApplyDetail.specName ? purchaseApplyDetail.specName : '--'}}
                                    </td>
                                    <td class="text-center">{{purchaseApplyDetail.isFixedName}}</td>
                                    <td class="text-center">
                                        {{purchaseApplyDetail.supplierName? purchaseApplyDetail.supplierName : '--'}}
                                    </td>
                                    <td class="text-center">{{purchaseApplyDetail.shName}}</td>
                                    <td class="text-center">
                                        {{purchaseApplyDetail.warehousingWayName}}{{purchaseApplyDetail.resOrderTypeName}}
                                    </td>
                                    <td class="text-center">
                                        {{purchaseApplyDetail.quantity}}{{purchaseApplyDetail.unitCodeName || ''}}
                                    </td>
                                    <td class="text-center">
                                        {{purchaseApplyDetail.purchaseQuantity ?
                                        purchaseApplyDetail.purchaseQuantity+purchaseApplyDetail.unitCodeName : '--'}}
                                    </td>
                                    <td class="text-center">
                                        ￥{{purchaseApplyDetail.price ? purchaseApplyDetail.price : '0.00'}}
                                    </td>
                                    <td class="text-center">
                                        <!--{{purchaseApplyDetail.resOrderType == '10000' ? '￥' +
                                        purchaseApplyDetail.totalApplyPrice : '-'}} -->
                                        ￥{{purchaseApplyDetail.totalApplyPrice}}
                                    </td>
                                    <td class="text-center">{{purchaseApplyDetail.remark}}
                                        <span class="fa fa-info-circle" v-if="purchaseApplyDetail.purchaseRemark != null
                                        && purchaseApplyDetail.purchaseRemark != undefined
                                        && purchaseApplyDetail.purchaseRemark != ''"
                                              @click="_viewPurchaseApplyDetail(purchaseApplyDetail)">
                                        </span>
                                    </td>
                                    <td class="text-center">{{purchaseApplyDetail.stateName}}</td>
                                    <td class="text-center">{{purchaseApplyDetail.createTime}}</td>
                                </tr>
                                </tbody>
                                <tfoot>
                                <tr>
                                    <td colspan="18">
                                        <ul class="pagination float-right"></ul>
                                    </td>
                                </tr>
                                </tfoot>
                            </table>
                            <!-- 分页 -->
                            <vc:create path="frame/pagination"></vc:create>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <vc:create path="common/viewImage"></vc:create>
</div>